package com.daykw.xiaohongshu;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Random;

import org.codehaus.plexus.util.StringUtils;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.daykw.xiaohongshu.http.HttpBase;
import com.daykw.xiaohongshu.model.Ips;
import com.daykw.xiaohongshu.util.ZKC;

public class Test {
	public static int s = 0;
	public static int f = 0;

	public static void main(String[] args) throws Exception {
		
		SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm");
		long t = 1520219007*1000L;;
		
		Date d = new Date(t);
		String date =formatter.format(d);
		System.out.print(date);
		JSONObject obj = new JSONObject();
		obj.put("time", date);
		String ta= "2018-08-01 16:52";
		obj.put("time", ta);
		String url = "http://www.xiaohongshu.com/discovery/item/579e255e78362359c137b8ed";
		
		String url1=url.substring(url.lastIndexOf("/")+1, url.length());

		ZKC zkc = ZKC.getZKClient();
		System.out.println(zkc);

		int max = 10;
		int min = 1;
		Random random = new Random();

		for (int i = 0; i < 100; i++) {
			int s = random.nextInt(max) % (max - min + 1) + min;
			System.out.println(s);
		}

		// String ip = "http://121653669296938502.s.y2000.com.cn/?num=500";
		String ip = "http://http-api.taiyangruanjian.com/getip?num=100&type=2&pro=&city=0&yys=0&port=1&pack=10415&ts=0&ys=0&cs=0&lb=1&sb=0&pb=4&mr=1&regions=";
		HttpBase http = new HttpBase();
		String ret = http.get(ip, "utf-8", null, false);
		JSONObject json = JSONObject.parseObject(ret);
		// JSONArray proxys = ipson.getJSONArray("data");
		JSONArray array = json.getJSONArray("data");

		// String[] array = ret.split("\r\n");
		

	}

}
